package com.shiguiwu.springboot3.search.controller;

import cn.hutool.json.JSONUtil;
import com.shiguiwu.springboot3.dto.UserDTO;
import com.shiguiwu.springboot3.util.R;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 测试
 * @author: stone
 * @date: Created by 2023/8/8 16:07
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springboot3.search.controller
 */
@RestController
@RequestMapping("/hello")
@Slf4j
public class HelloController {

    @PostMapping("/save")
    public R<String> save(@RequestBody @Valid UserDTO userDTO) {
        log.info("请求参数 ===> {}", JSONUtil.toJsonStr(userDTO));
        return R.ok("新增成功");
    }
}
